package com.cs.code.enums;


import com.cs.core.common.BaseEnum;

/**
 * @package com.cs.core.enums
 * @class TplType
 * @desc 模板类型
 * @author wind
 * @date    2023/9/19 9:56
 * @version v1.0
 */
public enum TplType implements BaseEnum<String> {


    FREEMARKER("freemarker", "ftl"),

    VELOCITY("velocity", "vm"),
    ;

    private final String name;

    /**
     * 后缀
     */
    private final String suffix;

    TplType(String name, String suffix) {
        this.name = name;
        this.suffix = suffix;
    }

    public String getName() {
        return name;
    }

    public String getSuffix() {
        return suffix;
    }

    @Override
    public boolean eq(String s) {
        return this.name.equals(s);
    }

    /**
     * 后缀比对
     * @param s
     * @return
     */
    public boolean equalSuffix(String s) {
        return this.suffix.equals(s);
    }
}
